using System;

namespace Com.Binaria.SISCOB.Funcional.DTO 
{

    [Serializable]
    public class RegistroContableFuncionalDTO 
    {

        public System.Int32? Id
        {
            get;
            set;
        }

        public System.Int32 IdDocumentoTransaccion
        {
            get;
            set;
        }

        public System.DateTime? FchRegistro
        {
            get;
            set;
        }

        public string FchRegistroText
        {
            get
            {
                if (FchRegistro.HasValue && FchRegistro.Value.Year > 1000)
                    return string.Format("{0}/{1}/{2}", FchRegistro.Value.Day.ToString("00"), FchRegistro.Value.Month.ToString("00"), FchRegistro.Value.Year.ToString("0000"));
                return string.Empty;
            }
            set
            {
                FchRegistro = null;
                if (!string.IsNullOrEmpty(value))
                {
                    string[] sVal = value.Split(new char[] { '/', '-' }, StringSplitOptions.RemoveEmptyEntries);
                    if (sVal.Length == 3)
                        FchRegistro = new DateTime(Convert.ToInt32(sVal[2]), Convert.ToInt32(sVal[1]), Convert.ToInt32(sVal[0]));
                }
            }
        }

        public System.String Glosa
        {
            get;
            set;
        }

        public System.Int64 Monto
        {
            get;
            set;
        }

        public System.String Tipo
        {
            get;
            set;
        }

        public System.String TipoText
        {
            get;
            set;
        }

        public System.String NmrDcto
        {
            get;
            set;
        }

        public System.String NmrAsiento
        {
            get;
            set;
        }

        public System.Boolean EstaProcesado
        {
            get;
            set;
        }

        string _Text = string.Empty;
        public string Text
        {
            get { return string.IsNullOrEmpty(_Text) ? Id.ToString() : _Text; }
        }
    }
}
